﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace planetExpressLib
{
    public class comentarioCAD
    {
        //Me permite obtener la cadena de conexión del webconfig
        static string conStr = ConfigurationManager.ConnectionStrings["DatabaseConnection"].ConnectionString;
        SqlConnection con = new SqlConnection(conStr);

        public comentarioEN insertComentarioCAD(comentarioEN com)
        {
            return null;
        }

        public void readComentarioCAD(int idComentario)
        {

        }

        public void deleteComentarioCAD(int idComentario)
        {

        }

        public void updateComentarioCAD(int idComentario)
        {

        }

        public DataTable gridviewComentListaCAD(string nombre)
        {

            DataTable bdVirtual = new DataTable();
            string comando = "SELECT Cliente FROM COMENTARIO WHERE (Planeta = (SELECT Id FROM PLANETA WHERE (Nombre = '" + nombre + "')))";
            SqlCommand cmd = new SqlCommand(comando, con);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.Fill(bdVirtual);

            return bdVirtual;
        }


    }
}
